package com.courseSchedulingSystem.controller.admin;


import com.courseSchedulingSystem.common.result.Result;
import com.courseSchedulingSystem.controller.base.BaseController;
import com.courseSchedulingSystem.pojo.dto.StudentLoginDTO;
import com.courseSchedulingSystem.pojo.entity.*;
import com.courseSchedulingSystem.pojo.vo.StudentLoginVO;
import com.courseSchedulingSystem.service.impl.AdminServiceImpl;
import com.courseSchedulingSystem.service.impl.CommonServiceImpl;
import com.courseSchedulingSystem.service.impl.StudentServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/api/admin")
public class AdminController extends BaseController {
    @Autowired
    private AdminServiceImpl adminService;
    @Autowired
    private StudentServiceImpl studentService;
    @Autowired
    private CommonServiceImpl commonService;

//    @PostMapping("/login/{adminId}/{password}")
//    public Result<StudentLoginVO> login(@PathVariable("adminId") int adminId, @PathVariable("password")String password) {
//        //写一个jwt鉴权的方法
//        StudentLoginVO studentLoginVO = null;
//        Map<String, String> data = studentService.login(new StudentLoginDTO(stuId, password));
//
//        int stuId = Integer.parseInt(data.get("stuId"));
//        String stuPassword = data.get("stuPassword");
//        StudentLoginDTO studentLoginDTO = new StudentLoginDTO(stuId,stuPassword);
//        Student student = studentService.selectAllByStuId(stuId);
//
//        log.info("用户登录请求{}",studentLoginDTO);
//        studentLoginVO = studentService.login(studentLoginDTO);
//        return Result.success(studentLoginVO);
//    }


}
